package com.xc.freeapp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xc.freeapp.dao.PicscrollDao;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.Picscroll;
import com.xc.freeapp.service.PicscrollService;

@Service
public class PicscrollServiceImpl implements PicscrollService {

	@Autowired
	private PicscrollDao picscrollDao;
	
	public Picscroll selectByPrimaryKey(Integer id) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return picscrollDao.selectByPrimaryKey(id);
	}

	public List<Picscroll> getList(Map<String, Object> paramsmap) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		List<Picscroll> list = picscrollDao.getList(paramsmap);
		/*if(list!=null&&!list.isEmpty()){
			for(Picscroll picscroll :list){
				if(picscroll.getPic()!=null&&!"".equals(picscroll.getPic())){
					picscroll.setPic(Base64PictureUtil.pathTopicture(picscroll.getPic()));
				}
			}
		}*/
		return list;
	}

}
